package com.kaluli.project.service;

import java.text.DecimalFormat;

import com.kaluli.project.utils.AlipayMd5Encrypt;

public class TestSign {

	public static void main(String[] args) {

		String key = "z3rjfy5ycjxuodox3oc3njo6ylv4znj5";
		// String key = "jg9g7ixbyb20pt84b6ztadfocg1ertwq";
		// z3rjfy5ycjxuodox3oc3njo6ylv4znj5
		String signStr = "_input_charset=UTF-8&amount=0.1&customs_place=ZONGSHU&merchant_customs_code=3122469897&merchant_customs_name=RANKA(HK)LIMITED&out_request_no=201607221440070236&partner=2088421447057891&service=alipay.acquire.customs&trade_no=2016080221001003040270011041";
		String sign = AlipayMd5Encrypt.md5(signStr + key);
		System.out.println(sign);
		// https://mapi.alipay.com/gateway.do?_input_charset=UTF-8&amount=0.1&customs_place=ZONGSHU&merchant_customs_code=3122469897&merchant_customs_name=RANKA(HK)LIMITED&out_request_no=201607221440070236&partner=2088421447057891&service=alipay.acquire.customs&trade_no=2016080221001003040270011041&sign=4b9995a38e3729d6e2e52af86190bdc2&sign_type=MD5
		Double d = 429.1;
		Double tax = d * 11.9 / 100;
		DecimalFormat df = new DecimalFormat("#.####");
		System.out.println(df.format(tax));
		
		String attr = "{\"\u989c\u8272\":\"\u9ed1\u8272\",\"img\":\"http://shihuo.hupucdn.com/uploads/kaluli/item/201506/0214/7f260f1bd87083154736c80c2c7e9d67.jpg\"}";
		
		System.out.println(attr);
	}

}
